Controlling Compressed Source Devices
In QuickTime 1.5, video digitizers could provide compressed data directly to clients. However, there was no way to preflight the settings for compression. In QuickTime 2.1, a new function,
VDGetCompressionTime
, has been added to allow the video digitizer to quantify the compression time for the actual quality levels that will be used.
VDGetCompressionTime
Your component receives the
VDGetCompressionTime
request whenever a client of the digitizer wants to confirm or quantify its compression settings.
pascal VideoDigitizerError VDGetCompressionTime (
VideoDigitizerComponent ci,
OSType compressionType,
short depth,
Rect *srcRect,
CodecQ *spatialQuality,
CodecQ *temporalQuality,
unsigned long *compressTime);
-
ci
-
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's
OpenComponent
function.
-
compressionType
-
Specifies a compressor type. This value corresponds to the component subtype of the compressor component. See the chapter "Image Compression Manager" in
Inside Macintosh: QuickTime
for more information about compressor types, including valid values for this parameter.
-
depth
-
Specifies the depth at which the image is to be compressed. Values of 1, 2, 4, 8, 16, 24, and 32 indicate the number of bits per pixel for color images. Values of 33, 34, 36, and 40 indicate 1-bit, 2-bit, 4-bit, and 8-bit grayscale, respectively, for grayscale images.
-
srcRect
-
Contains a pointer to a rectangle defining the portion of the source image to compress.
-
spatialQuality
-
Contains a pointer to a field containing the desired compressed image quality. The compressor sets this field to the closest actual quality that it can achieve. See the chapter "Image Compression Manager" in
Inside Macintosh: QuickTime
for valid values. A value of
nil
indicates that the client does not want this information.
-
temporalQuality
-
Contains a pointer to a field containing the desired sequence temporal quality. The compressor sets this field to the closest actual quality that it can achieve. See the chapter "Image Compression Manager" in
Inside Macintosh: QuickTime
for valid values. A value of
nil
indicates that the client does not want this information.
-
compressTime
-
Contains a pointer to a field to receive the compression time, in milliseconds. If your component cannot determine the amount of time required to compress the image, set this field to 0. A value of
nil
indicates that the client does not want this information.
DISCUSSION
The sequence grabber's video compression settings dialog box uses this function to snap the quality slider to the correct value when working with a compression type that is specified by the video digitizer.
Your component should return a long integer indicating the maximum number of milliseconds it would require to compress the specified image.
RESULT CODES
noErr
|
0
|
No error
|
paramErr
|
-50
|
Invalid parameter specified
|
© 1999 Apple Computer, Inc.| Previous | Chapter Contents | Chapter Top | Next |